# Makefile - Panda Messenger

# Program name 
EXE = panda

# Execution rules
.PHONY : clean mrproper info compiling endinfo

# Compiler
CC = gcc

# Compiler options
CFLAGS  = -W -g

# Linker options
LDFLAGS = -lnsl -lpthread

# Source files
SRC = $(wildcard *.c)
OBJ = $(SRC:.c=.o)

all : info $(EXE) clean compiling endinfo 

info :
	@echo "------------------------- Panda messenger --------------------------------------"
	@echo ""
	@echo "                              _,add8ba,"
	@echo "                            ,d888888888b,"
	@echo "                           d8888888888888b                        _,ad8ba,_"
	@echo "                          d888888888888888)                     ,d888888888b,"
	@echo "                          I8888888888888888 _________          ,8888888888888b"
	@echo "                __________\`Y88888888888888P\"\"\"\"\"\"\"\"\"\"\"baaa,__ ,888888888888888,"
	@echo "            ,adP\"\"\"\"\"\"\"\"\"\"\"9888888888P\"\"^                 ^\"\"Y8888888888888888I"
	@echo "         ,a8\"^           ,d888P\"888P^                           ^\"Y8888888888P'"
	@echo "       ,a8^            ,d8888'                                     ^Y8888888P'"
	@echo "      a88'           ,d8888P'                                        I88P\"^"
	@echo "    ,d88'           d88888P'                                          \"b,"
	@echo "   ,d88'           d888888'                                            \`b,"
	@echo "  ,d88'           d888888I                                              \`b,"
	@echo "  d88I           ,8888888'            ___                                \`b,"
	@echo " ,888'           d8888888          ,d88888b,              ____            \`b,"
	@echo " d888           ,8888888I         d88888888b,           ,d8888b,           \`b"
	@echo ",8888           I8888888I        d8888888888I          ,88888888b           8,"
	@echo "I8888           88888888b       d88888888888'          8888888888b          8I"
	@echo "d8886           888888888       Y888888888P'           Y8888888888,        ,8b"
	@echo "88888b          I88888888b      \`Y8888888^             \`Y888888888I        d88,"
	@echo "Y88888b         \`888888888b,      \`\"\"\"\"^                \`Y8888888P'       d888I"
	@echo "\`888888b         88888888888b,                           \`Y8888P^        d88888"
	@echo " Y888888b       ,8888888888888ba,_          _______        \`\"\"^        ,d888888"
	@echo " I8888888b,    ,888888888888888888ba,_     d88888888b               ,ad8888888I"
	@echo " \`888888888b,  I8888888888888888888888b,    ^\"Y888P\"^      ____.,ad88888888888I"
	@echo "  88888888888b,\`888888888888888888888888b,     \"\"      ad888888888888888888888'"
	@echo "  8888888888888698888888888888888888888888b_,ad88ba,_,d88888888888888888888888"
	@echo "  88888888888888888888888888888888888888888b,\`\"\"\"^ d8888888888888888888888888I"
	@echo "  8888888888888888888888888888888888888888888baaad888888888888888888888888888'"
	@echo "  Y8888888888888888888888888888888888888888888888888888888888888888888888888P"
	@echo "  I888888888888888888888888888888888888888888888P^  ^Y8888888888888888888888'"
	@echo "  \`Y88888888888888888P88888888888888888888888888'     ^88888888888888888888I"
	@echo "  \`Y8888888888888888 \`8888888888888888888888888       8888888888888888888P'"
	@echo "    \`Y888888888888888  \`888888888888888888888888,     ,888888888888888888P'"
	@echo "     \`Y88888888888888b  \`88888888888888888888888I     I888888888888888888'"
	@echo "       \"Y8888888888888b  \`8888888888888888888888I     I88888888888888888'"
	@echo "         \"Y88888888888P   \`888888888888888888888b     d8888888888888888'"
	@echo "            ^\"\"\"\"\"\"\"\"^     \`Y88888888888888888888,    888888888888888P'"
	@echo "                             \"8888888888888888888b,   Y888888888888P^"
	@echo "                              \`Y888888888888888888b   \`Y8888888P\"^"
	@echo "                                \"Y8888888888888888P     \`\"\"\"\"^"
	@echo "                                  \`\"YY88888888888P'"
	@echo "--------------------------------------------------------------------------------"

$(EXE) : $(OBJ)
	@$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

%.o : %.c
	@$(CC) $(CFLAGS) -c $< -o $*.o

compiling :
	@echo "Compilation completed"

clean :
	@rm -f $(OBJ)
	@rm -f *~
	@rm -f .~*\#

mrproper : clean
	@rm -f $(EXE)

endinfo :
	@echo "--------------------------------------------------------------------------------"

